import { defineConfig } from 'vite'
import uni from '@dcloudio/vite-plugin-uni'
import commonjs from '@rollup/plugin-commonjs'
import ViteCompression from 'vite-plugin-compression';
// https://vitejs.dev/config/
export default defineConfig({
  plugins: [
    commonjs(),
    uni(),
    ViteCompression({
      verbose: true, // 可选，启用详细日志
      disable: false, // 可选，false 表示启用压缩，true 表示禁用压缩
      threshold: 10240, // 可选，文件大小超过这个值才会被压缩（单位：字节）
    }),
  ],
  optimizeDeps: {
    include: ['bootstrap-vue'],
  },
  build: {
    commonjsOptions: {
      exclude: ['ckeditor/*'],
    },
    // rollupOptions: {
    //   external: ['pinia-plugin-persistedstate','firstui-uni']
    // }
  }
})
